class Appointment {
    Patient patient
    Doctor doctor
    String reason = 'sick visit'
    String status = 'booked';  // book, cancel, provisional,missed,complete
    String location
    Date startTime
    int duration = 1
    Date reminderDate
    String notes

    static belongsTo = [Patient, Doctor]
    static optionals = ["notes"]

    static constraints = {
        patient(blank:false)
        doctor(blank:false)
        reason(inList:['annual','sick visit','follow-up','referral'])
        status(inList:['booked','cancelled','missed','complete']);
        location(inList:['Windsor','Simsbury','Manchester','West Hartford'])
        startTime()
        duration(min:1,max:3,maxLength:1,blank:false)
   //     reminderDate(validator: { return (it > new Date())},blank:false)
        notes(maxLength:100)
    }
}
